package listbyorder.access201_300.test263;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/8/20 13:37
 */
public class Solution13 {

    public boolean isUgly(int num) {
        if (num < 1) return false;
        if (num == 1 || num == 2 || num == 5 || num == 3) return true;
        if (num % 2 == 0 && isUgly(num / 2)) return true;
        if (num % 3 == 0 && isUgly(num / 3)) return true;
        if (num % 5 == 0 && isUgly(num / 5)) return true;
        return false;
    }
}
